// Copyright (c) 2024, the Dart project authors.
// All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:ffi' as ffi;

import 'package:meta/meta.dart';

import 'arkreference.dart';
import 'types.dart';

/// A high level wrapper over an Ark object reference.
class ArkObject {
  final NapiObjectPtr _object;
  
  ArkObject(this._object);
  
  NapiObjectPtr get reference => _object;
  
  bool get isNull => _object == ffi.Pointer.fromAddress(0);
  
  @override
  String toString() => 'ArkObject($_object)';
}